<?php

namespace app\common\model;

use think\Model;


class FastNews extends Model
{

    

    

    // 表名
    protected $name = 'fast_news';
    
    // 追加属性
    protected $append = [
    	'maincontent_url'
    ];

    public function getCoverimageAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['coverimage']) ? $data['coverimage'] : '');
        return get_app_image_url($value);
    }

    public function getMaincontentUrlAttr($value, $data)
    {
        return url('/api/index2/fastnewsCon', ['id'=>$data['id']], true, true);
    }

    public function getCreatetimeAttr($value)
    {
        return date('Y-m-d H:i', $value);
    }

    



}
